#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPaintEvent>
#include <QSqlQuery>
#include <QMouseEvent>
#include <QListWidgetItem>




namespace Ui {
class SignUpWidget;
}

class SignUpWidget : public QWidget
{
    Q_OBJECT

public:
    explicit SignUpWidget(QWidget *parent = nullptr);
    bool select_identify_();
    bool account_input_();
    bool passws_input_();
    bool second_passed_input_();
    bool same_passwd();
    bool Repetiton();
    ~SignUpWidget() override;

    void mousePressEvent(QMouseEvent *event) override;

    void mouseMoveEvent(QMouseEvent *event) override;

    void mouseReleaseEvent(QMouseEvent *event) override;

private:
    Ui::SignUpWidget *ui;
    QSqlDatabase db;
    void paintEvent(QPaintEvent *e)override;
    bool m_dragging = false;
    QPoint m_dragPosition;
public slots:
    //注册
    void Register();
    //显示注册时输入的密码
    void Show_Passwd(bool checked);
    //隐藏注册时输入的密码
    void Hide_Passwd(bool checked);


    //设置注册时的身份选择只能有一个
    void Only_select_one_limts(QListWidgetItem *changedItem);
    //根据已选择身份注册
    void Identify_register();


private slots:
    void on_account_editingFinished();
    void on_password_editingFinished();
    void on_close_button_clicked();

    void minimizeWindow()
    {
            showMinimized();  // 最小化到任务栏
     }
};

#endif // WIDGET_H

